<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="div1">
        <input type="number">角度 = <input type="number">弧度
    </div>
    <script>
        let jd = document.querySelector("#div1>input:nth-child(1)");
        let hd = document.querySelector("#div1>input:nth-child(2)");

        jd.oninput = function() {
            let v = jd.value;
            let b = Math.PI / 180;
            hd.value = v * b;
        }

        hd.oninput = function() {
            let v = hd.value;
            let b = 180 / Math.PI;
            jd.value = v * b;
        }
    </script>
</body>
</html>